High performance probabilistic rate policer

ABSTRACT

A data flow rate policer enforces data flow policies for a number of data flows using a probabilistic policy enforcement mechanism. The policer includes a memory that stores the state of each data flow in a compact data structure. Additionally, the policer includes one or more policing engines that implement the actual data flow policies based on information derived from the data structures. The policing engines may be implemented in hardware to increase performance.

BACKGROUND OF THE INVENTION

A. Field of the Invention

The present invention relates generally to data switching and routing,and more particularly, to systems and methods for controlling data flow.

B. Description of Related Art

Routers receive data on physical media, such as optical fiber, analyzethe data to determine its destination, and output the data on physicalmedia in accordance with the destination. Routers were initiallydesigned using a general purpose processor executing large softwareprograms. As line rates and traffic volume increased, however, generalpurpose processors could not scale to meet these new demands. Forexample, as functionality was added to the software, such as accountingand policing functionality, these routers suffered performancedegradation. In some instances, the routers failed to handle traffic atline rate when the new functionality was turned on.

To meet the new demands, purpose-built routers were architected.Purpose-built routers are designed and built with components optimizedfor routing. They not only handled higher line rates and higher networktraffic volume, they also added functionality without compromising linerate performance.

Flow-control refers to the metering of packet flow through the networkand/or through the router. For example, it may be desirable to limit thenumber of packets received from a certain port of the router to apre-designated rate. One known method of implementing flow-control isbased on a credit system. With this method, each data flow that is to becontrolled is associated with a credit counter. As packets in the floware transmitted by the router, the credit counter is decremented.Conversely, the credit counter is incremented based on a creditreplenishment scheme, such as by periodically incrementing the creditcounter up to a maximum credit amount. The router checks the creditcounter before transmitting a packet and drops the packet if the creditcounter is below a predetermined value. Through the operation of thistype of credit-counter, the router can enforce a data flow policy suchas limiting the maximum transmission rate for a particular data flowbelow a certain rate.

FIG. 1 is a diagram illustrating an exemplary situation in which flowcontrol may be used to enforce data flow policies. As is generally shownin FIG. 1, an Internet Service Provider (ISP) 104 may provide networkservices to a number of customers. A customer may be, for example, acorporation or an individual. Each customer is associated with acustomer router/switch 101–103. Routers/switches 101–103 connect theusers associated with a customer, such as users 110, to ISP 104. ISP104, in turn, connects the customers to network 105 (e.g., theInternet). Routers 120 of ISP 104 handle the actual routing of packetdata between network 105 and the customer routers/switches 101–103.

ISP 104 may wish to give each customer a predetermined guaranteedbandwidth. The total bandwidth of the data flow coming from eachcustomer should not exceed this bandwidth. If it does, ISP 104 may droppackets from the customer's data flow. Traditional credit-based flowcontrol techniques, such as those discussed above, may be used by ISP104 to manage the bandwidth being used by the ISP's customers.

One drawback of traditional credit-based flow control techniques is thatthese techniques tend to produce “choppy” traffic patterns wheninteracting with other network protocols, such as the commonly usedTransmission Control Protocol (TCP). FIG. 2 is a diagram illustrating atypical choppy traffic pattern that occurs through the interaction ofTCP with traditional credit-based traffic flow techniques. Line 201represents the predetermined maximum bandwidth available to thecustomer. Line 202 represents the instantaneous bandwidth of a packetflow. Above line 201, conventional credit-based flow control techniquesdrop all packets. The sudden increase in dropped packets may causenetwork devices that implement TCP earlier in the data flow path torespond by scaling back the rate of transmitted packets, causing thetransmitted bandwidth to suddenly decrease. This pattern ofover-transmission followed by over-reduction in the bandwidth of thedata flow forms the choppy data flow pattern shown by line 202. Thistype of pattern flow makes inefficient use of the allotted bandwidth.

Accordingly, there is a need in the art to improve traditional flowcontrol techniques.

SUMMARY OF THE INVENTION

Systems and methods consistent with the principles of the invention,among other things, provide for improved data flow policy enforcementmechanisms.

One aspect consistent with the principles of the invention is directedto a data flow policing device. The device includes a policer and amemory. The policer is configured to receive a policing request thatincludes an indication of a packet belonging to a data flow. The policerdetermines whether the packet is within specification using a functionthat implements a probabilistic comparison based on a credit countassociated with the data flow. The memory stores a data structurecorresponding to the data flow. The data structure includes the creditcount of the data flow.

Another aspect consistent with the principles of the invention isdirected to a data flow policing device that includes a memoryconfigured to store data structures corresponding to a plurality of dataflows and a policer. The data structures include at least a credit countassociated with the data flows. The policer receives a policing requestthat includes an indication of a packet belonging to at least one of thedata flows. The policer, in response to the request, reads the datastructure corresponding to the data flow from the memory, determineswhether the packet is within specification based on the credit countassociated with the data flow, and writes an updated version of the readdata structure to the memory.

Yet another aspect consistent with the invention is directed to a methodthat includes receiving a request to perform a credit based flow controloperation. The request identifies at least the length of a data packetand a flow to which the data packet belongs. The method also includesreading a data structure corresponding to the identified flow from amemory, where the data structure includes at least an indication of acredit count associated with the data flow. Further, the method includesdetermining whether the data packet is within specification based on thecredit count and the packet length and updates the data structure in thememory.

A further aspect consistent with the invention is a network devicecomprising a physical interface configured to receive packets from andtransmit packets to a network and a processing unit. The processing unitis configured to store the received packets and examine headerinformation of the packets to determine a destination device for thepackets. The processing unit includes a route lookup unit that comprisesa plurality of route lookup engines, a policer, and a memory. Thepolicer receives a policing request for a packet associated with a dataflow from one of the route lookup engines and determines whether thepacket is within specification based on information contained in thedata structure associated with the data flow. The memory is coupled tothe policer and stores the data structure corresponding to the dataflow.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments of the invention and,together with the description, explain the invention. In the drawings,

FIG. 1 is a diagram illustrating an exemplary situation in which flowcontrol may be used to enforce data flow policies;

FIG. 2 is a diagram illustrating a typical choppy traffic pattern thatoccurs through the interaction of TCP with traditional credit-basedtraffic flow techniques;

FIG. 3 is a block diagram illustrating an exemplary routing system;

FIG. 4 is an exemplary detailed block diagram illustrating portions ofthe routing system shown in FIG. 3;

FIG. 5 is an exemplary configuration of a flexible port concentratoraccording to an implementation consistent with the principles of theinvention;

FIG. 6 is a diagram illustrating portions of the routing system shown inFIG. 3 that relate to data flow policing;

FIG. 7 illustrates a data structure used to store state information fora data flow;

FIG. 8 is a flow chart illustrating exemplary operation of thecomponents illustrated in FIG. 6;

FIG. 9 is a diagram that conceptually illustrates the operation of adata flow policer in determining whether a packet is withinspecification; and

FIG. 10 is a diagram illustrating an exemplary hardware implementationof a policing engine.

DETAILED DESCRIPTION

The following detailed description of the invention refers to theaccompanying drawings. The same reference numbers may be used indifferent drawings to identify the same or similar elements. Also, thefollowing detailed description does not limit the invention. Instead,the scope of the invention is defined by the appended claims andequivalents of the claim limitations.

As described herein, a rate policer enforces data flow policies for anumber of data flows using a probabilistic policy enforcement mechanism.The state of each data flow is stored in a compact data structure,allowing the number of data flows handled by the policer to beprogrammably increased or decreased. The computations performed by therate policer can be implemented in hardware to increase performance.

System Configuration

FIG. 3 is a block diagram illustrating an exemplary routing system 300in which systems and methods consistent with the principles of theinvention may be implemented. System 300 receives data from a physicallink, processes the data to determine destination information, andtransmits the data out on a link in accordance with the destinationinformation. System 300 may include packet forwarding engines (PFEs)310, a switch fabric 320, and a routing engine (RE) 330.

RE 330 performs high level management functions for system 300. Forexample, RE 330 may communicate with other networks and systemsconnected to system 300 to exchange information regarding networktopology. RE 330 may create routing tables based on network topologyinformation, create forwarding tables based on the routing tables, andforward the forwarding tables to PFEs 310. PFEs 310 may use theforwarding tables to perform route lookup for incoming packets. RE 330may also performs other general control and monitoring functions forsystem 300.

PFEs 310 are each connected to RE 330 and switch fabric 320. PFEs 310receive data at ports on links connected to a device or a network, suchas a wide area network (WAN) or a local area network (LAN). Each linkcould be one of many types of transport media, such as optical fiber,Ethernet cable, or wireless. The data on the link is formatted accordingto one of several protocols, such as the synchronous optical network(SONET) standard or Ethernet.

PFE 310 processes incoming data by stripping off the data link layer.PFE 310 may convert header information from the remaining data into datastructures referred to herein as “cells” (where a cell is a fixed lengthdata unit). For example, in one embodiment, the data remaining after thedata link layer is stripped off is packet data. PFE 310 includes thelayer 2 (L2) and layer 3 (L3) packet header information, some controlinformation regarding the packets, and the packet data in a series ofcells called “D” cells. In one embodiment, the L2, L3, and the controlinformation are stored in the first two cells of the series of cells.

PFE 310 may form a notification based on the L2, L3, and controlinformation, and performs a route lookup using the notification and therouting table from RE 330 to determine destination information. PFE 310may also further process the notification to perform protocol-specificfunctions, policing, and accounting, and might even modify thenotification to form a new notification. One policing function that maybe performed by PFE 310 is flow control, such as credit based flowcontrol, as will be described below.

If the determined destination indicates that the packet should be sentout on a link connected to PFE 310, then PFE 310 retrieves the cells forthe packet, converts the notification or new notification into headerinformation, forms a packet using the packet data from the cells and theheader information, and transmits the packet from the port associatedwith the link.

If the destination indicates that the packet should be sent to anotherPFE via switch fabric 320, then PFE 310 retrieves the cells for thepacket, modifies the first two cells with the new notification and newcontrol information, if necessary, and sends the cells to the other PFEvia switch fabric 320. Before transmitting the cells over switch fabric320, PFE 310 may append a sequence number to each cell, which allows thereceiving PFE to reconstruct the order of the transmitted cells.Additionally, the receiving PFE uses the notification to form a packetusing the packet data from the cells, and sends the packet out on theport associated with the appropriate physical link of the receiving PFE.

In summary, in one embodiment, RE 330, PFEs 310, and switch fabric 320perform routing based on packet-level processing. PFEs 310 store eachpacket in cells while performing a route lookup using a notification,which is based on packet header information, including L2 and L3 layerheader information. A packet might be received on one PFE and go backout to the network on the same PFE, or be sent through switch fabric 320to be sent out to the network on a different PFE.

FIG. 4 is an exemplary detailed block diagram illustrating portions ofrouting system 300. PFEs 310 connect to one another through switchfabric 320. Each of the PFEs may include one or more physical interfacecards (PICs) 410 and flexible port concentrators (FPCs) 420.

PIC 410 may transmit data between a link and FPC 420. Different PICs maybe designed to handle different types of links. For example, one of PICs410 may be an interface for an optical link, another PIC may be aninterface for an Ethernet link, and another a wireless interface.

FPCs 420 perform routing functions and handle packet transfers to andfrom PICs 410 and switch fabric 320. For each packet it handles, FPC 420performs the previously-discussed route lookup function. Although FIG. 4shows two PICs 410 connected to each of FPCs 420 and three FPCs 420connected to switch fabric 320, in other embodiments consistent withprinciples of the invention there can be more or fewer PICs 410 and FPCs420.

FIG. 5 is an exemplary configuration of FPC 420 according to animplementation consistent with the principles of the invention. FPC 420may include processing units 532 and 534, first input/output (I/O) unit536, second I/O unit 538, memory unit 540, and R unit 542. Although FIG.5 illustrates each processing unit 532 and 534 corresponding to one ofPICs 410, other embodiments consistent with the principles of theinvention may have additional PICs 410 attached to each processing unit532 and 534.

As will be described in greater detail below, processing units 532 and534 may process packet data flowing between PICs 410 and first I/O unit536. Each processing unit 532 and 534 may operate to process packet datareceived from the PIC(s) connected to it and to process data receivedfrom first I/O unit 536.

More particularly, processing unit 532 or 534 may process packets fromPIC 410 to convert the packets into data cells, and transmit the datacells to first I/O unit 536. Data cells are the data structure used byFPC 420 internally for transporting and storing data. In oneimplementation, data cells are 64 bytes in length.

In the other direction, processing unit 532 or 534 receives data cellsfrom first I/O unit 536, extracts certain information and packet datafrom the data cells, and creates a packet based on the extractedinformation. Processing unit 532 or 534 creates the packet header fromthe information extracted from the data cells. In one embodiment,processing unit 532 or 534 creates L2 and L3 header information based onthe extracted information. The created L2 and L3 header informationconstitutes a new header that the packet uses as it is subsequentlytransmitted through the link.

Memory unit 540 may temporarily store data cells from first I/O unit 536and second I/O unit 538 and notifications from R unit 542. Memory unit540 may dispatch the notifications to first I/O unit 536 and second I/Ounit 538. In response, first I/O unit 536 and second I/O unit 538 mayuse the address information in the notification to read out data cellsfrom memory unit 540 that correspond to a notification. The notificationreceived from memory unit 540 may have been modified by R unit 542 withroute or encapsulation lookup results. First I/O unit 536 and second I/Ounit 538 may update the data cells read out of memory unit 540 withinformation from the modified notification. The data cells, which nowinclude information from the modified notification, are sent toprocessing unit 532, processing unit 534, or switch fabric 320,depending on which of first I/O unit 536 or second I/O unit 538 isprocessing the notification.

R unit 542 may receive notifications from first I/O unit 536 and secondI/O unit 538. R unit 542 may receive one or more forwarding tables fromRE 330 (FIG. 1), and use the forwarding tables and encapsulation tablesto perform route or encapsulation lookups. R unit 542 may insert thelookup result into a notification, which it may store in memory unit540.

R unit 542 may provide route lookup, accounting, and policingfunctionality based on the notifications. Consistent with aspects of theinvention, the policing function performed by R unit 542 includesprobabilistic packet flow policing. This aspect of the invention will bedescribed in more detail below.

Probabilistic Flow Policing

FIG. 6 is a diagram illustrating portions of R unit 542 as they relateto policing functionality implemented by routing system 300. R unit 542may include one or more route lookup engines 601 that receive thenotifications from first and second I/O units 536 and 538. Forsimplicity, only a single route lookup engine is shown, although inpractice multiple parallel route lookup engines 601 may be used. Theroute lookup engine 601 uses the forwarding tables from RE 330 toperform route lookups for the packets corresponding to the incomingnotifications. Each notification may include an indication of the dataflow corresponding to the packet and whether that data flow is subjectto policing. Based on this information in the notification, route lookupengine 601 determines whether to generate a request to policer 602.

In another embodiment consistent with the principles of the invention,route lookup engine 601, independently of the notifications, keeps trackof which data flows are subject to policing. Based on this information,router lookup engines determines whether to generate requests to policer602.

Policer 602 receives policing requests from route lookup engine 601. Inresponse, policer 602 determines whether the packet corresponding to therequest is within its credit limit specification. If it is, route lookupengine 601 forwards the packet as normal. If it is not, route lookupengine 601 may drop the packet. Alternatively, instead of simplydropping the packet, route lookup engine 601 may perform some otherfunction on the packet, such as tagging the packet for special handling.A packet corresponding to an acceptable credit count will be referred toherein as a packet that is “within specification” while packets that areto be dropped or tagged will be referred to as “out of specification”packets.

Data structure storage component 603 stores data structures, such asdata structures 610–612, which are used by policer 602. In oneimplementation consistent with aspects of the invention, data structurestorage component 603 is a high-speed random access memory that stores adata structure corresponding to each data flow on which policer 602 mayoperate. The data structures store information, such as the presentcredit count corresponding to the data flow.

FIG. 7 is a diagram illustrating an exemplary implementation of one ofthe data structures 610–612, illustrated as data structure 710. Asshown, data structure 710 includes out-of-spec packet counter field 701,credit_count field 702, time_credit field 703, R field 704, U field 705,CL field 706, and last_adjustment_time field 707. An unused pad field708 may also be included. Policer 602 uses out-of-spec packet counterfield 701 to keep track of the number of packets that it determines tobe out of specification. Time_credit field 703 stores a value thatrepresents the amount of credit to allot per unit of time. Credit_countfield 702 stores the current count and last_adjust_time field 707indicates the previous time that the credit counter was increased.

R field 704 stores a value that determines the granularity of the timevalue kept by policer 602 when determining current_time. For example,based on R field 704, the time value kept by policer 602 may have aperiod of 5.6 micro-seconds ( 1/1024 of the core clock period), 210micro-seconds ( 1/32 of the core clock period), 6712 micro-seconds (thecore clock period), or 215092 micro-seconds (32 times the core clockperiod). U field 705 stores a value that represents the granularity withwhich the actual packet length (PLEN) is used in calculating the newcredit value. In one implementation, PLEN is multiplied by 2 raised tothe value stored in U field 705 to obtain an adjusted packet length thatis then subtracted from credit_count. Thus, when U field 705 stores thevalue zero, the adjusted packet length is equal to the actual packetlength. CL field 1006 stores the value of credit_limit.

In one exemplary implementation, data structure 710 may be a 128 bitstructure divided into four 32 bit words. More specifically, unused padfield 708 and out-of-spec packet counter field 702 may be 32 bit fields,current credit field 702 may be a 19 bit field, and time credit field703 may be a 13 bit field. R field 704, U field 705, CL field 706, andlast adjustment time field 707 may be, respectively, two bit, four bit,four bit, and 22 bit fields.

Time_credit field 703, R field 704, U field 705, and CL field 706 areuser programmable values that are generally held constant throughout theoperation of system 300. In contrast, out-of-spec packet counter 701,credit_count field 702, and last_adjustment_time field 707 may bedynamically adjusted by policer 602 when it processes the datastructure's corresponding packet.

FIG. 8 is a flow chart illustrating exemplary operation of route lookupengine 601, policer 602, and data structure storage component 603. Aspreviously mentioned, route lookup engine 601 decides whether to performcredit-based flow control on a received packet based on an indication inthe notification corresponding to the packet. In this manner, system 300can be configured to perform flow control only on certain packet flows.When performing flow control, route lookup engine 601 begins bytransmitting a request to policer 602 (Act 801). The request may includean indication of the packet's length and an identification of the dataflow to which the packet belongs.

In response to the request, policer 602 accesses data structure storagecomponent 603 and requests the data structure corresponding to the dataflow (Act 802). Policer 602 receives the corresponding data structurefrom data structure storage component 603 (Act 803). As described above,the fields in the data structure include a current credit field(credit_count) that stores the current number of credits associated withthe flow and a credit limit field (CL) that specifies the maximumallowed value of the current credit field.

With the data structure corresponding to the active data flow in hand,policer 602 processes the data structure (Act 804). Policer 602 thenreturns an updated version of the data structure to data structurestorage component 603 and transmits an indication of whether the packetis within specification or out of specification to route lookup engine601 (Acts 805 and 806).

FIG. 9 is a diagram that conceptually illustrates the operation ofpolicer 602 in determining whether a packet is in or out ofspecification for a data flow. The current credit count for theparticular data flow is illustrated by arrow 901. Each time policer 602processes a packet for the flow, it increments the current credit countbased on the elapsed time from the last packet processed for the flow.The current credit count may be incremented up to a maximum count value(i.e., the credit limit). Each time policer 602 processes a packet forthe flow, it also decrements the current credit count based on thepacket length. When the newly adjusted credit count is within region902, the packet is within specification. When the newly adjusted creditcount is within region 903, the packet is probabilistically withinspecification. In region 903, policer 602 decides whether the packet iswithin specification or out of specification based on a probabilityfunction. One such probability function is illustrated in the right handportion of FIG. 9. As shown, the probability of a packet in region 903being considered out of specification linearly increases from zero atthe top of region 903 to a maximum value P₀ at the bottom of region 903,where P₀ is a programmable value (e.g., 0.8). Below region 903, theprobability of the packet being considered out of specification is 100percent.

FIG. 10 is a diagram illustrating a portion of policer 602 thatdetermines whether a packet is within specification. In general, policer602 includes two main processing components, credit increment component1002, and decision component 1003. To maximize processing speed, thesecomponents may be implemented in hardware (e.g., as one or moreapplication specific integrated circuits). To further increasethroughput, policer 602 may include multiple parallel credit incrementcomponents 1002 and decision components 1003.

In general, policer 602 includes two main processing components, creditincrement component 1002, and decision component 1003. Credit incrementcomponent 1002 and decision component 1003 receive a number ofparameters. More particularly, credit increment component 1002 receivestime_credit field 703, last_adjust_time field 807, and an indication ofthe current time (current_time). Time_credit and last_time are stored inthe data structure corresponding to the data flow. Current_time is anindication of a current time value kept by policer 602. Last_adjust_timeindicates the previous time that the credit counter was increased. Basedon these three values, credit increment component 1002 calculates“credit_increment,” which indicates how much the current credit countshould be incremented. More specifically, credit increment component1002 generates credit_increment based on the difference betweencurrent_time and last_adjust_time multiplied by time_credit, whichrepresents the amount of credit the counter receives per time increment.Stated more formally,credit_increment=(current_time−last_adjust_time)×time_credit.

Decision component 1003 receives credit_increment from credit incrementcomponent 1002. Additionally, decision component 1003 receives anindication of the packet length (PLEN), the credit limit for the flow,and the credit count (credit_count field 702) that was generated for theprevious packet processed for the flow. The packet length is receivedfrom the requesting route lookup engine 601. Credit_limit andcredit_count are included in the data structure corresponding to theflow.

Decision component 1003 generates a new credit value based on the packetlength, credit_count, and credit_increment. For example, the new creditvalue may be generally calculated as the credit_count pluscredit_increment minus the packet length (or minus a value derived fromthe packet length). However, the maximum allowable value for the newcredit value is capped at the credit limit. Additionally, if decisioncomponent 1003 determines that the packet is out of specification and isto be dropped, the new credit value is not decremented based on thepacket length.

Decision component 1003 may generate the indication of whether or not apacket is within specification using the probabilistic functiondiscussed above. That is, when the value of new credit is within region902 (FIG. 9), the packet is within specification. If new credit value isin region 903, however, decision component 1003 may generate a randomnumber and compare it to the value of the probability function at thepresent credit count to determine whether the packet is withinspecification. Below region 903, decision component 1003 indicates thatthe packet is out of specification.

After policer engine 601 generates the new credit value and theindication of whether the packet is within specification, policer 602returns the indication of within specification or out of specificationto route lookup engine 601 and updates the data structure.

SUMMARY

As described above, a rate policer enforces data flow policies for anumber of data flows using a probabilistic policy enforcement mechanism.The probabilistic enforcement mechanism helps avoids the choppy andnon-uniform bandwidth pattern associated with conventional hard-dropcredit based rate policers. Because state information of each data flowoperated on by the rate policer is stored as a relatively small datastructure in memory, the number of flows operated on by the rate policercan be expanded simply by generating an additional data structure.Additionally, the core computation sections of the rate policer may beimplemented in hardware, thus increasing the performance of the ratepolicer.

The foregoing description of preferred embodiments of the inventionprovides illustration and description, but is not intended to beexhaustive or to limit the invention to the precise form disclosed.Modifications and variations are possible in light of the aboveteachings or may be acquired from practice of the invention. Moreover,while a series of acts has been presented with respect to FIG. 8, theorder of the acts may be different in other implementations consistentwith principles of the invention.

Also, PFEs 310 may be implemented in hardware, software, or somecombination thereof. For example, various portions of PFEs 310 may beimplemented as application-specific integrated circuits (ASICs). TheASICs may be configured to perform some processing via dedicated logic,and may also be configured to perform some processing using microcodeinstructions that may be stored in memory. Those skilled in the routerart will appreciate that the invention described herein might bepracticed using a variety of hardware configurations in addition to, orinstead of, ASICs. For example, some combination of general purposeprocessors, digital signal processors (DSPs), and programmable gatearrays (PGAs) may also be used to implement the functionality describedherein.

No element, act, or instruction used in the description of the presentapplication should be construed as critical or essential to theinvention unless explicitly described as such. Also, as used herein, thearticle “a” is intended to include one or more items. Where only oneitem is intended, the term “one” or similar language is used.

The scope of the invention is defined by the claims and theirequivalents.

1. A data flow policing device comprising: a policer configured toreceive a policing request that includes an indication of a packetbelonging to a data flow and to determine whether the packet is withinspecification using a function that implements a probabilistic functionbased on a credit count associated with the data flow, the policerdetermining whether the packet is within specification by comparing aprobability value derived from the credit count to a random number; anda memory configured to store a data structure corresponding to the dataflow, the data structure including at least the credit count of the dataflow.
 2. The data flow policing device of claim 1, further comprising: aroute lookup engine configured to transmit the policing request to thepolicer and configured to drop the packet when the policer determinesthat the packet is not within specification.
 3. A data flow policingdevice comprising: a policer configured to receive a policing requestthat includes an indication of a packet belonging to a data flow and todetermine whether the packet is within specification using a functionthat implements a probabilistic function based on a credit countassociated with the data flow, the policer further comprising a creditincrement component configured to calculate an amount to increment thecredit count, and a decision component configured to receive the amountto increment the credit count and generate the determination of whetherthe packet is within specification using the probabilistic functionbased on the credit count and as modified by a length of the packet andthe amount to increment the credit count; and a memory configured tostore a data structure corresponding to the data flow, the datastructure including at least the credit count associated with the dataflow.
 4. The data flow policing device of claim 3, wherein the creditincrement component and the decision component are implemented asapplication specific integrated circuits.
 5. The data flow policingdevice of claim 1, wherein the memory is configured to store a pluralityof data structures corresponding to a plurality of data flows.
 6. Thedata flow policing device of claim 1, wherein the data structure in thememory further includes: a field that stores an indication of a lasttime that the data structure was modified, and an indication of amaximum credit value for the credit count.
 7. A data flow policingdevice comprising: a memory configured to store data structurescorresponding to a plurality of data flows, the data structuresincluding at least a credit count associated with the data flows; and apolicer configured to: receive a policing request that includes anindication of a packet belonging to at least one of the data flows, readthe data structure corresponding to the data flow from the memory, inresponse to the request, determine whether the packet is withinspecification based on evaluation of a probabilistic function in whichthe credit count associated with the data flow is input as a parameterto the probabilistic function, and update the read data structure in thememory.
 8. The data flow policing device of claim 7, wherein theevaluation of the probabilistic function includes comparing aprobability value derived from the credit count to a random number. 9.The data flow policing device of claim 7, further comprising: a routelookup engine configured to transmit the policing request to the policerand drop the packet when the policer determines that the packet is notwithin specification.
 10. The data flow policing device of claim 7,wherein the policer further comprises: a credit increment componentconfigured to calculate an amount to increment the credit count, and adecision component configured to receive the amount to increment thecredit count and generate the determination of whether the packet iswithin specification using the probabilistic function in which thecredit count is modified by the length of the packet and the amount toincrement the credit count before being input to the probabilisticfunction.
 11. The data flow policing device of claim 10, wherein thecredit increment component and the decision component are implemented asapplication specific integrated circuits.
 12. A method comprising:receiving a request to perform a credit based flow control operation,the request identifying at least a length of a data packet and a flow towhich the data packet belongs; reading a data structure corresponding tothe identified flow from a memory, the data structure including at leasta credit count associated with the data flow; generating a randomnumber; determining whether the data packet is within specification bycomparing a probability value derived from the credit count to therandom number; and writing an updated version of the data structure tothe memory.
 13. The method of claim 12, further comprising: transmittingthe determination of whether the data packet is within specification toa device from which the request was received.
 14. The method of claim12, wherein the data structure additionally includes: an indication ofthe last time that the credit count was modified.
 15. The method ofclaim 12, wherein the data structure additionally includes: anindication of a maximum credit value for the credit count.
 16. Themethod of claim 12, wherein the data structure additionally includes: afield configured to store a count of the number of packets that are notwithin specification.
 17. A network device comprising: a physicalinterface configured to receive packets from and transmit packets to anetwork; and a processing unit configured to store the received packetsand determine a destination device for the packets, the processing unitincluding a route lookup unit that comprises: a plurality of routelookup engines, a policer configured to receive a policing request for apacket associated with a data flow from one of the plurality of routelookup engines and determine whether the packet is within specificationbased on information contained in a data structure associated with thedata flow, the data structure including at least a credit count of thedata flow, the policer determining whether the packet is withinspecification using a probabilistic function based on the credit count,the policer including a credit increment component configured tocalculate an amount to increment the credit count, and a decisioncomponent configured to receive the amount to increment the credit countand generate the determination of whether the packet is withinspecification using the probabilistic function based on the credit countthat is modified based on a length of the packet and the amount toincrement the credit count; and a memory configured to store the datastructure corresponding to the data flow.
 18. A network devicecomprising: a physical interface configured to receive packets from andtransmit packets to a network; and a processing unit configured to storethe received packets and determine a destination device for the packets,the processing unit including a route lookup unit that comprises: aplurality of route lookup engines, a policer configured to receive apolicing request for a packet associated with a data flow from one ofthe plurality of route lookup engines and determine whether the packetis within specification based on information contained in a datastructure associated with the data flow, the data structure including atleast a credit count of the data flow, the policer determining whetherthe packet is within specification using a probabilistic function basedon the credit count by comparing a probability value derived from thecredit count to a random number, and a memory configured to store thedata structure associated with the data flow.
 19. The network device ofclaim 17, wherein the one of the plurality of route lookup engines dropsthe packet when the policer determines that the packet is not withinspecification.
 20. The network device of claim 17, wherein the creditincrement component and the decision component are implemented asapplication specific integrated circuits.
 21. The network device ofclaim 17, wherein the memory is configured to store a plurality of datastructures corresponding to a plurality of data flows.